package com.ddd.demo.lee.数组;

public class A1 {

    public static void main(String[] args) {

        int[] arr = new int[]{1, 7, 3, 6, 5, 6};

        for (int i = 0; i < arr.length; i++) {
            if (sum(arr, 0, i) == sum(arr, i + 1, arr.length)) {
                System.out.println("i = " + i);
            }
        }

    }

    static int sum(int[] arr, int start, int end) {
        int result = 0;
        for (int i = start; i < end; i++) {
            result += arr[i];
        }
        return result;
    }
}
